﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class PromoFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As PromoBE
        Dim tmpPromo As PromoBE = New PromoBE()
        Try
            With tmpPromo
                .Al = convertDTFromDb.convertDateTime(dr.Item("Al"))
                .CantV = convertDTFromDb.ConvertDecimal(dr.Item("CantV"))
                .Compras = convertDTFromDb.ConvertDecimal(dr.Item("Compras"))
                .Del = convertDTFromDb.convertDateTime(dr.Item("Del"))
                .Descripcion = convertDTFromDb.ConvertString(dr.Item("Descripcion"))
                .Fecha = convertDTFromDb.convertDateTime(dr.Item("Fecha"))
                .Id = convertDTFromDb.convertInt32(dr.Item("Id"))
                .IdEmpresa = convertDTFromDb.ConvertShort(dr.Item("IdEmpresa"))
                .IdPromocion = convertDTFromDb.convertInt32(dr.Item("IdPromocion"))
                .Pagas = convertDTFromDb.ConvertDecimal(dr.Item("Pagas"))
                .PedirConf = convertDTFromDb.ConvertShort(dr.Item("PedirConf"))
                .Porc = convertDTFromDb.ConvertDecimal(dr.Item("Porc"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .Tipo = convertDTFromDb.ConvertShort(dr.Item("Tipo"))
                .TodosC = convertDTFromDb.ConvertShort(dr.Item("TodosC"))
                .Usr = convertDTFromDb.ConvertString(dr.Item("Usr"))
                .Vigencia = convertDTFromDb.ConvertShort(dr.Item("Vigencia"))
            End With
            Return tmpPromo
        Catch ex As Exception
            Throw
        Finally
            tmpPromo = Nothing
        End Try
    End Function
End Class
